<template>
	<view class="privacy-agreement" v-html="content"></view>
</template>

<script setup lang='ts'>
	import {
		ref,
		getCurrentInstance
	} from 'vue';
	import {
		onLoad
	} from "@dcloudio/uni-app";

	const {
		proxy
	} = getCurrentInstance();

	const content = ref('');

	const title = {
		3: '秒陪隐私政策',
		4: '秒陪服务协议',
		5: '关于我们',
		6: '商务合作'
	}

	onLoad((option) => {
		uni.setNavigationBarTitle({
			title: title[option.id] || '说明'
		});
		getData(option.id);
	})

	const getData = (id) => {
		const url = proxy.$API.getPrivacyAgreement;
		proxy.$UNIHTTP.getData(url, {
			id
		}).then((res: any) => {
			if (res.code == 1) {
				content.value = res.data[0]?.content || '';
			}
		})
	}
</script>

<style scoped lang='scss'>
	.privacy-agreement {
		padding: 20rpx;
	}
</style>